package com.zjhome.itoken.web.admin.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.zjhome.itoken.web.admin.interceptor.WebAdminInterceptor;

@Configuration
public class WebAdminInterceptorConfig implements WebMvcConfigurer  {
	
	@Bean
	WebAdminInterceptor WebAdminInterceptor() {
		return new WebAdminInterceptor();
	}
	
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		// 配置拦截器
		registry.addInterceptor(WebAdminInterceptor())
			.addPathPatterns("/**")
			.excludePathPatterns("/static");
		
	}

}
